﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="News.aspx.cs" Inherits="News"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<link rel="stylesheet" type="text/css" href="pro/bootstrap/css/bootstrap.min.css" media="all">
    <title>新闻列表</title>
    <script language="javascript" type="text/javascript">
    function Check(parentChk,ChildId)   
    {   
        var oElements = document.getElementsByTagName("INPUT");   
        var bIsChecked = parentChk.checked;   
      
       for(i=0; i<oElements.length;i++)   
        {   
            if( IsCheckBox(oElements[i]) &&    
                IsMatch(oElements[i].id, ChildId))   
            {   
                oElements[i].checked = bIsChecked;   
            }           
        }      
     }   
      
    function IsMatch(id, ChildId)   
    {   
        var sPattern ='^Repeater1.*'+ChildId+'$';   
        var oRegExp = new RegExp(sPattern);   
        if(oRegExp.exec(id))    
            return true;   
        else    
            return false;   
    }   
      
    function IsCheckBox(chk)   
    {   
        if(chk.type == 'checkbox') return true;   
        else return false;   
    }   

    </script>
</head>

<body>
    <form id="form1" runat="server">
    <div style="margin-bottom:20px;text-align:center;">
       <asp:Label ID="新闻列表" runat="server" Text="新闻列表" style="margin-bottom:20px;text-align:center;" />
      
    </div>
    
 <%--   <div style="position:absolute; right:0px;top:0px">
    <asp:Button ID="logout"  class="btn  btn-primary" runat="server" Text="注销" 
            align="right" onclick="logout_Click"></asp:Button>
    
    </div>--%>
    
<asp:Repeater ID="Repeater1" runat="server">
    <%--SeparatorTemplate描述一个介于每条记录之间的分隔符--%>
 <%--   <SeparatorTemplate>
        <tr>
        <td colspan="5"><hr /></td>
        </tr>
    </SeparatorTemplate>--%>
    
    <HeaderTemplate>
      <table class="table table-striped">
      	<thead>
      <tr>
        <%--<td><input id="chkAll" style="width:50px;" name="chkAll" runat="server" type="checkbox" onclick="Check(this,'chkItem')" title="全选" /></td>--%>
        <td>查看</td>
        <td>序号</td>
        <td>标题</td>
       
      </tr>
      	</thead>
    </HeaderTemplate>
    <ItemTemplate>
    <tbody>
      <tr>
        <%--<td><asp:CheckBox ID="chkItem" style="width:50px;"  runat="server" /></td>--%>
        <td><a href='<%# "ViewNews.aspx?id="+DataBinder.Eval(Container.DataItem, "id") %>' target="_blank">浏览</a></td>
        <td><asp:Label ID="lblID" Text='<%# DataBinder.Eval(Container.DataItem, "id")%>' runat="server"></asp:Label></td>
        <td><%# DataBinder.Eval(Container.DataItem, "title")%></td>
      </tr>
      </tbody>
    </ItemTemplate>
    <FooterTemplate>
     </table>
    </FooterTemplate>
</asp:Repeater>
<div >
    <%--<asp:Button ID="Button1" style="width:50px;" class="btn btn-primary" runat="server" Text="新增" OnClick="Button1_Click" />
    <asp:Button ID="btnDel" style="width:50px;" class="btn" runat="server" Text="删除" OnClick="btnDel_Click" />--%>
    
   <asp:label ID="lblCurrentPage" runat="server"></asp:label>
   <asp:HyperLink id="lnkFrist" runat="server">首页</asp:HyperLink>
   <asp:HyperLink id="lnkPrev" runat="server">上一页</asp:HyperLink>
   <asp:HyperLink id="lnkNext" runat="server">下一页</asp:HyperLink> 
   <asp:HyperLink id="lnkEnd" runat="server">尾页</asp:HyperLink>
</div>
    </form>
</body>
</html>